//
//  DemoVC.swift
//  BWUIKit_Example
//
//  Created by zhuxuhong on 2022/2/18.
//  Copyright © 2022 CocoaPods. All rights reserved.
//

import BWUIKit

class DemoVC: ViewController {
    @IBAction func rangeSliderValueChanged(_ sender: RangeSlider) {
        print("lower: \(sender.lowerValue), upper: \(sender.upperValue)")
    }

    override func didLayout() {
        super.didLayout()
        
        navBarBackgroundColor = .purple
        
        let appearance = navBar?.standardAppearance
        appearance?.titleTextAttributes = navBarTitleAttributes ?? [:]
        appearance?.setBackIndicatorImage(navBarBackIndicatorImage, transitionMaskImage: navBarBackIndicatorMaskImage)
        appearance?.backgroundImage = navBarBackgroundImage
        appearance?.shadowImage = navBarShadowImage
        appearance?.shadowColor = nil
        appearance?.backgroundEffect = nil
        appearance?.backgroundColor = navBarBackgroundColor
        
        navBar?.scrollEdgeAppearance = appearance
    }
    
    let label = UILabel(frame: .init(origin: .zero, size: .init(width: 100, height: 20)))
    override func layoutDidChange() {
        super.layoutDidChange()
        
        label.textColor = .red
        label.removeFromSuperview()
        label.text = "Center"
        label.textAlignment = .center
        label.center = view.center
        view.addSubview(label)
    }
}
